import {request} from '../utils/request'
// 优惠劵网址
// const BASE_URL_RECEIVE = "http://dev.marketing.lbs.p.yufeiworld.com" 
// const BASE_URL_RECEIVE = "http://dev.gateway.lbs.p.yufeiworld.com"
const BASE_URL_RECEIVE = ""
/* 
 用户领取优惠劵管理
*/
export type RECEIVE_DETAIL = {
    couponCode: string
    userId: number
}
// 优惠劵领取详情
export const request_post_receive_detail = (receiveDetail: Partial<RECEIVE_DETAIL>) => {
    return request({
        url: BASE_URL_RECEIVE + "/marketing/user/receive/detail",
        method: "POST",
        data: receiveDetail
    })
}


export type RECEIVE_LIST = {
    couponType?: number
    orderNo?: string
    pageNo: number
    pageSize: number
    receiveChannel?: number
    status?: number
    userId: number
}
// 用户优惠券列表
export const request_post_user_receive_list = (receiveList: Partial<RECEIVE_LIST>) => {
    return request({
        url: BASE_URL_RECEIVE + "/marketing/user/receive/list",
        method: "POST",
        data: receiveList
    })
}


export type RECEIVE_SAVE = {
    activityId: number,
    couponCode: string,
    couponId: number,
    receiveChannel: number,
    shopId: number,
    userId: number
}
// 用户领取优惠券
export const request_post_user_receive_save = (receiveSave: Partial<RECEIVE_SAVE>) => {
    return request({
        url: BASE_URL_RECEIVE + "/marketing/user/receive/save",
        method: "POST",
        data: receiveSave
    })
}